<% layout('/layouts/default.html', {title: '房源信息管理', libs: ['validate','fileupload','ueditor']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header with-border">
			<div class="box-title">
				<i class="fa fa-list-alt"></i> ${text(shHouse.isNewRecord ? '新增房源信息' : '编辑房源信息')}
			</div>
			<div class="box-tools pull-right">
				<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
			</div>
		</div>
		<#form:form id="inputForm" model="${shHouse}" action="${ctx}/sys/shHouse/save" method="post" class="form-horizontal">
			<div class="box-body">
				<div class="form-unit">${text('基本信息')}</div>
				<#form:hidden path="id"/>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required ">*</span> 标题：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:input path="title" maxlength="100" class="form-control required" />
							</div>
						</div>
					</div>
				<#form:hidden path="pics"/>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> TKD标题：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:textarea path="tkdTitle" rows="2" maxlength="150" class="form-control" placeholder="SEO功能"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> TKD关键字：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:textarea path="tkdKeywords" rows="2" maxlength="150" class="form-control" placeholder="SEO功能"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> TKD描述：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:textarea path="tkdDesc" rows="4" maxlength="255" class="form-control" placeholder="SEO功能"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> 是否热门：<i class="fa icon-question hide "></i></label>
							<div class="col-sm-8">
								<#form:select path="isHot" dictType="service_yes_no" class="form-control required" />
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> 投资回报率：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-6">
								<#form:input path="rateOfReturn" class="form-control number"  placeholder="示例:50%!"/>
							</div>
							<div class="col-sm-2">
								<span class="text-red">%</span>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> 价格：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="price" class="form-control required" maxlength="40" placeholder="请注意修改单位!"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> 管理费：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="managePrice" class="form-control required" maxlength="40" placeholder="请注意修改单位!"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> 月修缮费：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="monthRepairPrice" class="form-control" maxlength="40" placeholder="请注意修改单位!"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> 月管理费：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="monthManagePrice" class="form-control" maxlength="40"  placeholder="请注意修改单位!"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> 平米价格：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:select path="propertyType" dictType="service_property_type" class="form-control required digits" />
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> 房型格局：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="houseType" maxlength="40" class="form-control required" />
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> 室内面积：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-6">
								<#form:input path="indoorArea" class="form-control required number"/>
							</div>
							<div class="col-sm-2">
								<span class="text-red">㎡</span>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> 土地面积：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-6">
								<#form:input path="buildArea" class="form-control required number"/>
							</div>
							<div class="col-sm-2">
								<span class="text-red">㎡</span>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> 土地权利：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:select path="landRights" dictType="service_land_rights" class="form-control required digits" />
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> 目前状况：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:select path="currentStatus" dictType="service_current_status" class="form-control required digits" />
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> 建筑年月：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="buildDate" readonly="true" maxlength="20" class="form-control Wdate required"
									dataFormat="date" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> 建筑构造：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:select path="buildConstruction" dictType="service_build_construction" class="form-control required digits" />
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> 楼层结构：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="floorConstruction" maxlength="80" class="form-control required"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> 所在楼层：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-6">
								<#form:input path="floorsPos" maxlength="11" class="form-control required digits" placeholder="请输入正整数!"/>
							</div>
							<div class="col-sm-2">
								<span class="text-red">层</span>
							</div>
						</div>
					</div>
				<#form:hidden path="addrPic"/>
				<#form:hidden path="longitude"/>
				<#form:hidden path="latitude"/>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> 地区：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:select path="areaCondition" dictType="service_area_condition" class="form-control required digits" />
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> 用途：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:select path="useCondition" dictType="service_use_condition" class="form-control required digits" />
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required ">*</span> 物件地址：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:input path="addr" maxlength="150" class="form-control required"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required ">*</span> 交通线路：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:input path="transportLine" maxlength="100" class="form-control required"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2">图片集：</label>
							<div class="col-sm-10">
								<#form:fileupload id="uploadImage" bizKey="${shHouse.id}" bizType="shInfo_image"
								uploadType="image"  class="required" returnPath="true" filePathInputId="pics"
								maxUploadNum="5" imageMaxWidth="450"  imageMaxHeight="340" isMini="true"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2">物件位置：</label>
							<div class="col-sm-10">
								<#form:fileupload id="uploadAddrImage" bizKey="${shHouse.id}1" bizType="shInfo_image"
								uploadType="image"  class="required" returnPath="true" filePathInputId="addrPic"
								maxUploadNum="1" imageMaxWidth="1038"  imageMaxHeight="408" isMini="true"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required ">*</span> 内容：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:ueditor  maxlength="10000"  path="content" class="required"
								simpleToolbars="true"  outline="false"/>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="box-footer">
				<div class="row">
					<div class="col-sm-offset-2 col-sm-10">
						<% if (hasPermi('sys:shHouse:edit')){ %>
							<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('保 存')}</button>&nbsp;
						<% } %>
						<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
					</div>
				</div>
			</div>
		</#form:form>
	</div>
</div>
<% } %>
<script>
$("#inputForm").validate({
	submitHandler: function(form){
		js.ajaxSubmitForm($(form), function(data){
			js.showMessage(data.message);
			if(data.result == Global.TRUE){
				js.closeCurrentTabPage(function(contentWindow){
					contentWindow.page();
				});
			}
		}, "json");
    }
});
</script>